var edit_form_panel = Ext.create("Ext.form.Panel", {
	url: "",
	buttonAlign: "center",
	bodyStyle: "padding: 10px;",
	defaultType : "textfield",
	items: [{
			fieldLabel: "模型名称",
			emptyText: "请填写模型名称",
			name: "",
			width: "100%"
		},
		{
			fieldLabel: "模型key",
			emptyText: "请填写模型key",
			name: "",
			width: "100%"
		},
		{
			xtype: "combo",
			fieldLabel: "业务类别",
			emptyText: "请选择业务类别",
			name: "",
			//allowBlank: false,//是否允许为空
			editable: false,//是否可编辑
			lazyInit: false,//延时初始化下拉列表，默认为true
			triggerAction: 'all',
			valueField: 'value',
			width: "100%",
			store: new Ext.data.ArrayStore({
				fields: ['value', 'text'],
				data: [
						["1", "123"],
						["0", "456"]
				],
			}),
		},
		{
			fieldLabel: "模型版本",
			emptyText: "请填写模型版本",
			name: "",
			width: "100%"
		},
		{
			fieldLabel: "多租户标识",
			emptyText: "填写多租户标识",
			name: "",
			width: "100%"
		},
		{
			xtype: 'textarea',
			emptyText: "请填写模型描述",
			labelWidth: 100,
			fieldLabel: '描述',
			width: 400
		}
	],
	buttons: [{
		text: "保存",
		formBind: true, // only enabled once the form is valid
		disabled: true,
		handler: function() {
			var form = this.up("form").getForm();
			if (form.isValid()) {
				form.submit({
					waitMsg: "保存中...",
					success: function(form, action) {
						var message = action.result.result;
						Ext.Msg.alert("提示", message);
						edit_form_panel_win.close();
						dataStore.load();
					},
					failure: function(form, action) {
						Ext.Msg.alert("提示", "操作失败！");
					}
				});
			}
		}
	}]
});

var edit_form_panel_win = Ext.create("Ext.Window", {
	title: "委托信息修改",
	closeAction: "hide",
	width: 450,
	items: edit_form_panel
});

function myEdit(id) {
	/*Ext.Ajax.request({
		url: "",
		method: "POST",
		success: function(response) {
			var json = Ext.JSON.decode(response.responseText);
			edit_form_panel.getForm().reset();
			edit_form_panel.getForm().setValues(json.result);
			edit_form_panel_win.show();
		},
		failure: function(response) {
			Ext.Msg.alert("提示", "操作失败!");
		}
	});*/
	edit_form_panel.getForm().reset();
	edit_form_panel_win.show();
} // #myEdit
